package com.cyzy.domin;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 地区表，用于存储地区的名称信息
 * @TableName t_areas
 */
@TableName(value ="t_areas")
@Data
public class TAreas implements Serializable {
    /**
     * 地区ID，主键，自动递增
     */
    @TableId(type = IdType.AUTO)
    private Integer areasId;

    /**
     * 地区名称，不能为空
     */
    private String areasName;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TAreas other = (TAreas) that;
        return (this.getAreasId() == null ? other.getAreasId() == null : this.getAreasId().equals(other.getAreasId()))
            && (this.getAreasName() == null ? other.getAreasName() == null : this.getAreasName().equals(other.getAreasName()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAreasId() == null) ? 0 : getAreasId().hashCode());
        result = prime * result + ((getAreasName() == null) ? 0 : getAreasName().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", areasId=").append(areasId);
        sb.append(", areasName=").append(areasName);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}